package com.example.ddz.framework;

/**
 * Created by IntelliJ IDEA.
 * User: Marcel Melzig
 * Date: 19.07.11
 * Time: 20:08
 */

import java.util.List;

/**
 * @author Marcel Melzig
 * @version 0.0.1
 */
public interface IInput
{
    /**
     * This class defines a key event.
     */
    public static class KeyEvent
    {
        public static final int KEY_DOWN = 0;
        public static final int KEY_UP = 1;
        public int type;
        public int keyCode;
        public char keyChar;
    }

    /**
     * This class defines a touch event.
     */
    public static class TouchEvent
    {
        public static final int TOUCH_DOWN = 0;
        public static final int TOUCH_UP = 1;
        public static final int TOUCH_DRAGGED = 2;
        public int type;
        public int x, y;
        public int pointer;
    }

    /**
     * Shows if a key is pressed or not.
     *
     * @param keyCode The code of the pressed key.
     * @return A boolean describing the state of the key.
     */
    public boolean IsKeyPressed(int keyCode);

    /**
     * Shows if a touch event is actually ongoing.
     *
     * @param pointer The pointer of the touch event.
     * @return A boolean describing if a touch event is ongoing or not.
     */
    public boolean IsTouchDown(int pointer);

    /**
     * Gets the x coordinate of the touch event.
     *
     * @param pointer The pointer of the touch event.
     * @return The x coordinate of the pointer.
     */
    public int GetTouchX(int pointer);

    /**
     * Gets the y coordinate of the pointer.
     *
     * @param pointer The pointer of the touch event.
     * @return The y coordinate of the pointer.
     */
    public int GetTouchY(int pointer);

    /**
     * Gets the acceleration in horizontal direction.
     *
     * @return A value describing the acceleration in horizontal direction.
     */
    public float GetAccelX();

    /**
     * Gets the acceleration in vertical direction.
     *
     * @return A value describing the acceleration in vertical direction.
     */
    public float GetAccelY();

    /**
     * Gets the acceleration on the z axis.
     *
     * @return The acceleration on the z axis.
     */
    public float GetAccelZ();

    /**
     * Gets a list of the key events.
     *
     * @return A list of key events.
     */
    public List<KeyEvent> GetKeyEvents();

    /**
     * Gets a list of touch events.
     *
     * @return A list of touch events.
     */
    public List<TouchEvent> GetTouchEvents();
}
